function load(url, _callback_success, _callback_fail) {
	var callback_success = function(response) {
		console.log("load js success...", response);
	}
	var callback_fail = function(response) {
		console.log("load js fail...", response);
	}
	_callback_success = _callback_success || callback_success;
	_callback_fail = _callback_fail || callback_fail;
	
	$.getScript(url).done(_callback_success).fail(_callback_fail);
}
function loadScript(src, callback) {
    var script = document.createElement('script'),
	head = document.getElementsByTagName('head')[0];
    script.type = 'text/javascript';
    script.charset = 'UTF-8';
    script.src = src;
    if (script.addEventListener) {
        script.addEventListener('load', function () {
            callback();
        }, false);
    } else if (script.attachEvent) {
        script.attachEvent('onreadystatechange', function () {
            var target = window.event.srcElement;
            if (target.readyState == 'loaded') {
                callback();
            }
        });
    }
    head.appendChild(script);
}
var LoadJS = (function() {
	function LoadJS() {}
	
	//加载js的函数
	LoadJS.loadScript = function(url, callback) {
		callback = callback || {};
		loadScript(url, callback);
	}

	return LoadJS;
})();

export default LoadJS;
